package com.zzy.mapper;

import com.zzy.domain.User;
import com.zzy.domain.vo.PageQuery;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface UserMapper {
    List<User> list(PageQuery pageQuery);

    Integer add(User user);

    @Select("select * from user where id=#{id}")
    User getById(Integer id);

    @Update("update user set name=#{name}, role=#{role}, gender=#{gender}, contactInfo=#{contactInfo}, whether=#{whether} where id=#{id}")
    Integer update(User user);



     //新增删除方法
    @Delete("delete from user where id=#{id}")
    Integer delete(Integer id);

}